<template>
  <el-carousel @change="carouselChange">
    <el-carousel-item v-for="(item, index) in dataList" :key="index">
      <!-- <img
        :src="imgUrl + '/common/sysFile/showImg?fileId=' + item.fileId"
        alt="暂无图片"
        @click="jump(item)"
        style="cursor: pointer"
      /> -->
      <img :src="item.url" alt="暂无图片" style="cursor: pointer">
    </el-carousel-item>
  </el-carousel>
</template>
<script>
export default {
  name: 'MyCarousel',
  // eslint-disable-next-line vue/require-prop-types
  props: ['widget'],
  data() {
    return {
      imgUrl: process.env.VUE_APP_BASE_API,
      dataList: [
        { url: require('@/assets/image/common/temparary/aaaaaa.jpg') },
        { url: require('@/assets/image/common/temparary/bbbbbb.jpg') }
      ]
    }
  },
  computed: {},
  mounted() {
    // this.$api.noSignInApi
    //   ._listCompDefinePng({ compId: this.widget.id })
    //   .then((res) => {
    //     if (res.result !== "success") return;
    //     this.dataList = res.data;
    //   });
  },
  methods: {
    carouselChange(i) {},
    jump(item) {
      // 文章
      // if (item.dataWay === "1") {
      //   let routeData = this.$router.resolve({
      //     name: "lookDetail",
      //     query: {
      //       headerColor: "white",
      //       articleId: item.articleId,
      //       columnId: item.columnId,
      //       Breadcrumb: JSON.stringify([
      //         {
      //           name: "administrationMsg",
      //           codeName: item.columnName,
      //           query: { headerColor: "white", columnId: item.columnId },
      //         },
      //       ]),
      //     },
      //   });
      //   window.open(routeData.href, "_blank");
      // }
      // // 外部链接
      // else if (item.dataWay === "2") {
      //   item.pngUrl.indexOf("http://") > 0
      //     ? window.open(item.pngUrl)
      //     : window.open(`http://${item.pngUrl}`);
      // }
    }
  }
}
</script>
<style lang="scss" scoped>
img {
  width: 100%;
  height: 100%;
}
.el-carousel {
  height: 100%;
  ::v-deep .el-carousel__container {
    height: 100%;
  }
}
</style>
